//
//  MTEmptyDataHandler.h
//  空视图封装
//
//  Created by wang tiao on 2020/12/19.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

 
@interface TJEmptyDataModel: NSObject

@property (nonatomic, copy) NSString *iconName;
@property (nonatomic, copy) NSString *text;
@property (nonatomic, copy) NSString *loadButtonText;
@property (nonatomic, copy) NSString *detailText;
@property (nonatomic, copy) NSAttributedString *detailAttributedString;
@property (nonatomic, strong) UIColor *textColor;

 
@end



@interface TJEmptyDataHandler : NSObject


typedef NS_ENUM(NSInteger, TJEmptyDataType) {
    TJEmptyDataTypeBase,
    TJEmptyDataTypeOnlyText,
    TJEmptyDataTypeDetail,
};

+ (instancetype)emptyDataHandleWithScrollView:(UIScrollView *)scrollView;//默认MTEmptyDataTypeBase, 图片加一个文字
+ (instancetype)emptyDataHandleWithScrollView:(UIScrollView *)scrollView configuration:(TJEmptyDataType (^ _Nullable)(TJEmptyDataModel *dataModel))configuration;
- (void)reloadEmptyDataSet;

@property (nonatomic, assign) BOOL canDisplay;//默认不显示, 网络接口数据下来之后, 设置为YES, 没有数据会显示, 有数据就不会显示
@property (nonatomic, assign) BOOL ignoreOffset;//忽略 头部 和 top , 默认是NO
@property (nonatomic, assign) CGFloat offsetY;

@property (nonatomic, assign) CGFloat addOffsetY;

@property (nonatomic, copy) void (^didClickLoadButtonBlock)(void);
@property (nonatomic, strong) UIColor *backgroundColor;


@end


@interface TJEmptyDataView: UIView

@property (nonatomic, strong) UIButton *loadButton;
@property (nonatomic, assign) TJEmptyDataType emptyDataType;
@property (nonatomic, strong) TJEmptyDataModel *emptyDataModel;
@property (nonatomic, weak) UIView *lastView;

@end



NS_ASSUME_NONNULL_END
